from PIL import Image

p_w_picpath = Image.open('1.png')
print('width:%s, height:%s' % (p_w_picpath.size[0], p_w_picpath.size[1]))
half_size = (p_w_picpath.size[0]/2, p_w_picpath.size[1]/2)
p_w_picpath.thumbnail(half_size, Image.ANTIALIAS)
p_w_picpath.save('1.jpg', 'jpeg')

